package pl.umk.mat.fred.unicore.urc.storagemanagement.tree.filters;

import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.viewers.ViewerFilter;

import pl.umk.mat.fred.unicore.urc.storagemanagement.tree.nodes.CatalogNode;
import pl.umk.mat.fred.unicore.urc.storagemanagement.tree.nodes.FileNode;

public class OtherFileFilter extends ViewerFilter {

	@Override
	public boolean select(Viewer arg0, Object parent, Object node) {
		if (node instanceof FileNode) {
			FileNode fileNode = (FileNode) node;
			return fileNode.isMy();
		} if (node instanceof CatalogNode) {
			CatalogNode catalogNode = (CatalogNode) node;
			return catalogNode.isMy();
		}
		return true;
	}

}
